//
//  UIButton+FRP.h
//  Pods
//
//  Created by kepuna on 2017/10/18.
//
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, ButtonImagePositionStyle) {
    /// 图片在左，文字在右
    ButtonImagePositionStyleDefault,
    /// 图片在右，文字在左
    ButtonImagePositionStyleRight,
    /// 图片在上，文字在下
    ButtonImagePositionStyleTop,
    /// 图片在下，文字在上
    ButtonImagePositionStyleBottom
};

typedef NS_ENUM(NSInteger, ButtonVertificationCode) {
    ButtonVertificationCodeSecond, // s英文字母
    ButtonVertificationCodeHanzi // 显示“秒”
};

@interface UIButton (FRP)

/**
 初始化方法
 */
+ (instancetype)nx_initWith:(void (^)(UIButton *btn))initBlock;

/**
 设置frame
 */
- (UIButton *(^)(CGRect frame))nx_frame;

/**
 添加按钮到View
 */
- (UIButton *(^)(UIView *inView))nx_addInView;

/**
 设置某种state的按钮的image
 */
- (UIButton *(^)(NSString *name, UIControlState state))nx_imageForState;

/**
 设置某种state的按钮的文字
 */
- (UIButton *(^)(NSString *title, UIControlState state))nx_titleForState;

/**
 设置某种state的按钮的文字颜色
 */
- (UIButton *(^)(UIColor *color, UIControlState state))nx_titleColorForState;

/**
 设置按钮的背景颜色
 */
- (UIButton *(^)(UIColor *color))nx_backgroundColor;

/**
 设置按钮的背景颜色 isState表示是否处于某种state
 */
- (UIButton *(^)(UIColor *color, UIControlState state, BOOL isState))nx_backgroundColorForState;

/**
 设置文字大小
 */
- (UIButton *(^)(CGFloat fontSize))nx_fontSize;

/**
 设置字体name和大小
 */
- (UIButton *(^)(NSString *fontName ,CGFloat fontSize))nx_fontName;

/**
 设置按钮圆角
 */
- (UIButton *(^)(CGFloat value))nx_cornerRadius;

/**
 设置border 和 border的width
 */
- (UIButton *(^)(UIColor *color,CGFloat width))nx_borderAndWidth;

/**
 设置按钮上文字的对齐方式
 */
- (UIButton *(^)(UIControlContentHorizontalAlignment alignment))nx_contentAlignment;

/**
 设置target和action
 */
- (UIButton *(^)(id target,SEL action))nx_targetAction;

/**
 设置图片的位置和space
 */
- (UIButton *(^)(ButtonImagePositionStyle position,CGFloat spacing))nx_imagePositionAndSpace;
/**
 设置按钮是否隐藏
 */
- (UIButton *(^)(BOOL hidden))nx_hidden;

/**
 设置验证码样式按钮
 */
- (UIButton *(^)(NSInteger second, ButtonVertificationCode style))nx_vertificationCodeForStyle;
- (UIButton *(^)(NSInteger second, ButtonVertificationCode style, void(^CounterCompletionBlock)()))nx_vertificationCodeCompletionBlock;



@end
